x86/mtrr: Improvements to control register handling
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 9 May 2017 15:05:08 +0000 (15:05 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 30 May 2017 17:50:13 +0000 (18:50 +0100)
commit49df30c39b4db7be8d0c05a0d9efb529b68d275a
tree62623106d9481f53e2c74f509ca26ec0a6fe2e66
parentad0341c712fe5827a64bdfd191e018be345b126f
x86/mtrr: Improvements to control register handling

Use X86_CR0_CD rather than opencoding it (and its inversion).  Drop the
pointless cr0 variable.

Xen always uses CR4.PGE, and altering PGE is a full TLB flush.  There is no
need to call flush_tlb_local() (which itself, toggles CR4.PGE rather than
writing to CR3!) as well as clearing CR4.PGE.  The static cr4 variable isn't
needed either.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/mtrr/generic.c